//加载模块
const  express = require('express');

//创建app对象
const path = require('path');
const db = require(path.join(__dirname,'db'));
const cors = require('cors');
const app = express();

//指定接口，开启服务
app.listen(3000,() => console.log('serve is run'));

//配置cors
app.use(cors());

//配置post请求体
app.use(express.urlencoded({extended:false}));

let book = require(path.join(__dirname,'routers','book'));
app.use('/api',book);


